﻿<%@ Page Language="C#" MasterPageFile="~/Forum.master" AutoEventWireup="true" CodeBehind="ForumLandingPage.aspx.cs" Inherits="Forums.ForumLandingPage"  %>
<%@ Register src="UserControls/SearchFunction.ascx" tagname="SearchFunction" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="searchContentHolder" runat="server">
    <uc1:SearchFunction ID="SearchFunction1" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mainContentHolder" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ForumLandingPageTopic10" style="margin-top: 0px" 
        AllowPaging="True">
        <Columns>
            <asp:TemplateField HeaderText="Main Topics">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" CssClass="threadLink" 
                        NavigateUrl='<%# Eval("TopicID", "ForumTopicPage.aspx?topicId={0}") %>' 
                        Text='<%# Eval("TopicName") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="LastThreadDate" HeaderText="Date of Last Activity" 
                SortExpression="LastThreadDate" DataFormatString="{0:D}" >
            </asp:BoundField>
            <asp:BoundField DataField="NumOfThreads" HeaderText="Number of Threads" 
                SortExpression="NumOfThreads" >
            </asp:BoundField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="ForumLandingPageTopic10" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CentForumsDB %>" 
        SelectCommand="SELECT [TopicID], [TopicName], [LastThreadDate], [NumOfThreads] FROM [vw_TopicSummary]"></asp:SqlDataSource>

</asp:Content>
